Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body onmousedown="myFunction(event)" onmouseup="myFunction(event)" onkeydown="myFunction(event)" onkeyup="myFunction(event)"> <p>Press any key or click the mouse in this document to get what type of event that was triggered.</p> <p>Event: <span id="demo"></span></p> <script> function myFunction(event) { var x = event.type; document.getElementById("demo").innerHTML = x; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_event_type by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:30:35 GMT --> </html>
Result:
Try it Yourself - © w3schools.com